package com.example.springioc.demo4;

import lombok.Data;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Component;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Hua YY
 * Date: 2024-11-19
 * Time: 12:13
 */
@Component

public class D4BeanConfig {
    @Bean
    //@Primary
    public D4UserInfo d4UserInfo(){
        return new D4UserInfo("zhangsan",18);
    }
    @Bean(name = {"lisi","d4UserInfo2"})
    public D4UserInfo d4UserInfo2(){
        return  new D4UserInfo("lisi",18);

    }
    @Bean
    public D4UserInfo d4UserInfo3(){
        return new D4UserInfo("wangwu",18);
    }
}
